//
//  RemarkTableViewCell.m
//  GuoBuJiaForIphone
//
//  Created by zhangwo on 16/11/8.
//  Copyright © 2016年 GuoBuJia. All rights reserved.
//

#import "RemarkTableViewCell.h"

@implementation RemarkTableViewCell
@synthesize topLine = _topLine;
@synthesize buttomLine = _buttomLine;
@synthesize dataImage = _dataImage;
@synthesize bgImageView = _bgImageView;
@synthesize dataLabel = _dataLabel;
@synthesize locaImage = _locaImage;
@synthesize locaLabel = _locaLabel;
@synthesize timeImage = _timeImage;
@synthesize timeLabel = _timeLabel;

@synthesize outLocaImage = _outLocaImage;
@synthesize outLocaLabel = _outLocaLabel;
@synthesize outTimeImage = _outTimeImage;
@synthesize outTimeLabel = _outTimeLabel;

@synthesize dataList = _dataList;

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _dataImage = [[UIImageView alloc] initWithFrame:CGRectMake(35, 25, 15, 15)];
        _dataImage.image = [UIImage imageNamed:@"icon-sign-violetImage.png"];
        [self addSubview:_dataImage];
        
        _dataLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 8, 100, 20)];
        _dataLabel.textColor = [UIColor colorWithHexString:@"0x108CEF"];
        _dataLabel.font = [UIFont systemFontOfSize:12.0];
        [self addSubview:_dataLabel];
        
        _topLine = [[UIView alloc] initWithFrame:CGRectMake(42, 25, 1, 0)];
        _topLine.backgroundColor = [UIColor colorWithHexString:@"0xD8D8D8"];
        [self addSubview:_topLine];
        
        _buttomLine = [[UIView alloc] initWithFrame:CGRectMake(42, 25, 1, 160)];
        _buttomLine.backgroundColor = [UIColor colorWithHexString:@"0xD8D8D8"];
        [self addSubview:_buttomLine];

        _bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(70, 10, SWIDTH-90, 150)];
        _bgImageView.image = [UIImage imageNamed:@"icon-sign-record-bgimage.png"];
        
        _locaImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, 15, 20, 20)];
        _locaImage.image = [UIImage imageNamed:@"icon-sgin-loca.png"];
        [_bgImageView addSubview:_locaImage];
        
        _locaLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, 10, _bgImageView.frame.size.width-50, 40)];
        _locaLabel.font = [UIFont systemFontOfSize:14.0];
        _locaLabel.numberOfLines = 2;
        [_bgImageView addSubview:_locaLabel];
        
        _timeImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, 50, 20, 20)];
        _timeImage.image = [UIImage imageNamed:@"icon-sgin-time.png"];
        [_bgImageView addSubview:_timeImage];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, 50, _bgImageView.frame.size.width-50, 20)];
        _timeLabel.font = [UIFont systemFontOfSize:14.0];
        [_bgImageView addSubview:_timeLabel];
        
        
        _outLocaImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, 80, 20, 20)];
        _outLocaImage.image = [UIImage imageNamed:@"icon-sgin-loca.png"];
        [_bgImageView addSubview:_outLocaImage];
        
        _outLocaLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, 75, _bgImageView.frame.size.width-50, 40)];
        _outLocaLabel.font = [UIFont systemFontOfSize:14.0];
        _outLocaLabel.numberOfLines = 2;
        [_bgImageView addSubview:_outLocaLabel];
        
        _outTimeImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, 115, 20, 20)];
        _outTimeImage.image = [UIImage imageNamed:@"icon-sgin-time.png"];
        [_bgImageView addSubview:_outTimeImage];
        
        _outTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, 115, _bgImageView.frame.size.width-50, 20)];
        _outTimeLabel.font = [UIFont systemFontOfSize:14.0];
        [_bgImageView addSubview:_outTimeLabel];
        
        [self addSubview:_bgImageView];
    }
    return self;
}

- (void)setDataList:(NSDictionary *)dataList
{
    _dataList = dataList;
    [_dataLabel setText:[dataList objectForKey:@"checkdate"]];
    [_locaLabel setText:[dataList objectForKey:@"address"]];
    [_timeLabel setText:[NSString stringWithFormat:@"签到时间:%@",[dataList objectForKey:@"checkin"]]];
    [_outLocaLabel setText:[dataList objectForKey:@"address_out"]];
    [_outTimeLabel setText:[NSString stringWithFormat:@"签退时间:%@",[dataList objectForKey:@"checkout"]]];
}

@end
